﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace Drafter.Model
{
    public class Chapter
    {
        public string Title { get; set; }
        public string Text { get; set; }
        public string Notes { get; set; }
        public ObservableCollection<Chapter> ChildChapters { get; set; }
        
        public Chapter()
        {
            ChildChapters = new ObservableCollection<Chapter>();
        }

        public void AppendChapterTreeText(StringBuilder sb)
        {
            sb.AppendLine("-------------------------------------------------------------------------");
            sb.AppendLine(this.Title);
            sb.AppendLine("-------------------------------------------------------------------------");
            sb.AppendLine(this.Text);
            foreach (Chapter childChapter in this.ChildChapters)
	        {
                childChapter.AppendChapterTreeText(sb);
	        }
        }
    }

}
